﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Cos.Core.Model.Media;

namespace Cos.Module.Media
{
    public interface IImageService
    {
        /**
         * Retrieve an image
         * 
         * @param imageEntry image entry
         * @return the image
         * @throws IOException if the image can't be retrieved
         */
        byte[] GetImage(ImageEntry imageEntry) /*throws IOException*/;

        /**
         * Check if the image is available
         * 
         * @param imageEntry describe an image
         * @return true if the image exists, false otherwise.
         */
        bool IsImageAvailableOnLocal(ImageEntry imageEntry);

        /**
         * Retrieve the last time when the image has been modified
         * 
         * @param imageEntry the image entry
         * @return the last modify time
         */
        DateTime GetLastModifyTime(ImageEntry imageEntry);

        /**
         * Save the image
         * 
         * @param imageEntry the imageEntry
         * @param imageStream the image inputstream
         * @throws IOException if the image can't be saved
         */
        void Save(ImageEntry imageEntry, Stream imageStream) /*throws IOException*/;
    }
}
